package com.oracle.outsidein.process;

import java.io.InputStream;

/**
 * Copies standard output and error of subprocesses to list of lines.
 */
public class LinesPumpStreamHandler extends PumpStreamHandler {

    /**
     * Construct a new {@code LinesPumpStreamHandler}.
     *
     * @param output The stream for output.
     * @param error  The stream for errors.
     */
    public LinesPumpStreamHandler(final InputStream output, final InputStream error) {
        super(new LinesStreamPumper(output), new LinesStreamPumper(error));
    }

    @Override
    public LinesStreamPumper getOutputPumper() {
        return (LinesStreamPumper) super.getOutputPumper();
    }

    @Override
    public LinesStreamPumper getErrorPumper() {
        return (LinesStreamPumper) super.getErrorPumper();
    }
}
